{extend name="../../admin/view/public/admin"}

{block name='content'}

<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item)}编辑{else}新建{/if}商品分类
    	<small>{if !empty($item)}(名称: {$item['name']}){/if}</small>
    </span>
</div>

<div class="page-content">
    <div class="page-sub-toolbar">
		<span class=''>
            <a class="btn btn-primary btn-sm" href="{:webUrl('web.goods.category/add')}">添加新分类</a>
		</span>
    </div>
    <form action="" method="post" class="form-horizontal form-validate" enctype="multipart/form-data">

        {if !empty($item['id'])}
        <div class="form-group">
            <label class="col-sm-2 control-label">分类链接(点击复制)</label>
            <div class="col-sm-9 col-xs-12">
                <div class='form-control-static'>
                    <a class=" js-clip" data-url="gcate/{$item['id']}" title='复制链接'>gcate/{$item['id']}</a>
                </div>
            </div>
        </div>
        {/if}

        {if !empty($parentid)}
        <div class="form-group">
            <label class="col-sm-2 control-label">上级分类</label>
            <div class="col-sm-9 col-xs-12 control-label" style="text-align:left;">
                {if !empty($parent1)}{$parent1['name']} >> {/if}
                {$parent['name']}
            </div>
        </div>
        {/if}

        <!--模块类型（business:主要业务;customer:客户关系;activity:营销及活动;services:常用服务及工具;biz:行业解决方案;sale:营销类;tool:工具类;help:辅助类;enterprise:企业应用;h5game:H5游戏;other:其他;）-->

        <div class="form-group">
            <label class="col-sm-2 control-label">排序</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="displayorder" class="form-control" value="{$item['displayorder']}"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label must">分类名称</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="name" class="form-control" value="{$item['name']}" data-rule-required='true'/>
            </div>
        </div>

        {if empty($parentid)}
        <div class="form-group">
            <label class="col-sm-2 control-label">分类描述</label>
            <div class="col-sm-9 col-xs-12">
                <textarea name="description" id="" rows="4" class="form-control">{$item['description']}</textarea>
            </div>
        </div>
        {/if}

        <div class="form-group">
            <label class="col-sm-2 control-label">是否显示</label>
            <div class="col-sm-9 col-xs-12">
                <label class='radio-inline'>
                    <input type='radio' name='enabled' value='1' {if $item['enabled']==1}checked{/if} /> 是
                </label>
                <label class='radio-inline'>
                    <input type='radio' name='enabled' value='0' {if $item['enabled']==0}checked{/if} /> 否
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-9 col-xs-12">
                <input type="submit" value="提交" class="btn btn-primary"/>
                <input type="button" name="back" onclick='history.back()' style='margin-left:10px;' value="返回列表" class="btn btn-default"/>
            </div>
        </div>

    </form>
</div>


{/block}